<% layout('layout/layout') %>
<% block('header').append(`<style>
</style>`)%>
<div  class="row">
  <div class="col-xs-12">
    <div class="box">
      <div class="box-header">
        <h3 class="box-title">邮费管理</h3>
        <div class="box-tools">
          <a class="btn  btn-sm btn-success" href="add">添加邮费规则</a>
          <!--<div class="input-group input-group-sm" style="width: 150px;">-->
          <!--<input type="text" name="table_search" class="form-control pull-right" placeholder="Search">-->

          <!--<div class="input-group-btn">-->
          <!--<button type="submit" class="btn btn-default"><i class="fa fa-search"></i></button>-->
          <!--</div>-->
          <!--</div>-->
        </div>
      </div>
      <!-- /.box-header -->
      <div id="postageWrap" class="box-body table-responsive no-padding">
        <table class="table table-bordered table-hover">
          <tbody>
          <tr>
            <th>省份</th>
            <th>城市</th>
            <th>是否有效</th>
            <th>邮费</th>
            <th>操作</th>
          </tr>
          <% postages.forEach(function(item){%>
          <tr>
            <td><%=item.province %></td>
            <td><%=item.city %></td>
            <td><%=item.isValid ?'有效':'无效'%></td>
            <td><%=item.fee %></td>
            <td>
              <a class="btn  btn-sm btn-success" href="add?update=<%=item._id %>">修改</a>
              <a class="btn btn-delete  btn-sm btn-danger" data-id="<%=item._id%>" data-url="<%=assetsPath %>/postage/delete" href="javascript:void(0)">删除</a>
            </td>
          </tr>
          <% }) %>
          </tbody>
        </table>
      </div>
      <!-- /.box-body -->
    </div>
    <!-- /.box -->
  </div>

</div>

<% block('footer').append(`<script>
    jQuery(function() {
    	$.delBtn('#postageWrap','你确定要删除这个邮费规则么？')
    })

</script>`)%>